//                       .::::.
//                     .::::::::.
//                    :::::::::::
//                 ..:::::::::::'
//              '::::::::::::'
//                .::::::::::
//           '::::::::::::::..
//                ..::::::::::::.
//              ``::::::::::::::::
//               ::::``:::::::::'        .:::.
//              ::::'   ':::::'       .::::::::.
//            .::::'      ::::     .:::::::'::::.
//           .:::'       :::::  .:::::::::' ':::::.
//          .::'        :::::.:::::::::'      ':::::.
//         .::'         ::::::::::::::'         ``::::.
//     ...:::           ::::::::::::'              ``::.
//    ```` ':.          ':::::::::'                  ::::..
//                       '.:::::'                    ':'````..
package com.wxx.controller.api.sys;

import com.wxx.service.api.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.text.ParseException;
import java.util.Map;

@Controller
@RequestMapping("/api/code/")
public class CodeController {

    @Autowired
    private CodeService codeService;

    /**
     * 发送验证码
     * @param phoneCode    区号  +86 代表中国
     * @param phoneNum    手机号
     * @return
     */
    @RequestMapping(value = "sendCode", method = RequestMethod.POST)
    @ResponseBody
    public Object sendCode(HttpServletRequest request, String phoneCode, String phoneNum) throws ParseException {

        Map map = codeService.sendCode(phoneCode, phoneNum);
        return map;
    }

}
